package com.qijian.quality.domain.excel;


import com.alibaba.fastjson.annotation.JSONField;
import com.qijian.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@ApiModel("事故报告Excel")
@Data
public class IncidentReport {

    @Excel(name = "部门")
    private String deptName;
    @Excel(name = "部门负责人")
    private String nickName;
    @Excel(name = "区域责任人")
    private String areaChargeUserName;
    @JSONField(format = "yyyy-MM-dd")
    @Excel(name = "日期")
    private Date checkDate;
    @Excel(name = "事故经过")
    private String describe;
    @Excel(name = "姓名")
    private String woundedUser;
    @Excel(name = "职务/工种")
    private String workType;
    @Excel(name = "年龄")
    private Integer age;
    @Excel(name = "损伤情况")
    private String remark;
    @Excel(name = "伤残等级")
    private String disabilityLevel;
    @Excel(name = "事故类型")
    private String accidentNature;
    @Excel(name = "事故类别")
    private String accidentType;
    @Excel(name = "事故等级")
    private String accidentLevel;
    @Excel(name = "损失工作日")
    private String loseWorkDays;
    @Excel(name = "医疗损失")
    private BigDecimal loseMedicalDamage;
    @Excel(name = "设备设施损失")
    private BigDecimal loseDevice;
    @Excel(name = "其他损失")
    private BigDecimal loseOther;
    @Excel(name = "合计")
    private BigDecimal money;
    @Excel(name = "责任部门")
    private String dutyDept;
    @Excel(name = "生产副总")
    private String ProductionViceManager;
    @Excel(name = "起重组")
    private String craneGroup;
    @Excel(name = "事故地点")
    private String area;
    @Excel(name = "事故时间")
    private String incidentTime;
    @Excel(name = "受伤部位")
    private String disabilityPart;
    @Excel(name = "区域安全员")
    private String areaSafetyUser;

    private String accidentUser;

    //责任人和伤员为同一个
    public void setWoundedUser(String woundedUser) {
        this.woundedUser = woundedUser;
        this.accidentUser = woundedUser;
    }

    //万元转为元
    public void setMoney(BigDecimal money) {
        if (money != null)
            this.money = money.multiply(new BigDecimal(10000));
    }
}
